package ygw.study.designPatterns.strategy;

/**
 * <p>
 * 设计模式-策略模式
 * </p>
 * <p>
 * Copyright:2021.All rights reserved.
 * </p>
 * <p>
 * Company:Zsoft
 * </p>
 * <p>
 * CreateDate:2021-05-18 10:56
 * </p>
 *
 * @author YuGongWen
 * @history Mender:YuGongWen；Date:2021-05-18 10:56；
 */
public class TestStrategy {

    public static void main(String[] args) {

        ContextStrategy contextStrategy = new ContextStrategy(new OperationAdd());
        int i = contextStrategy.executeStrategy(8, 2);
        System.out.println(i);

        contextStrategy = new ContextStrategy(new OperationMultiply());
        i = contextStrategy.executeStrategy(8,2);
        System.out.println(i);
        
        


    }


}